import { BaseEntity, Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import Company from './company.entity';

/**
 * 照片
 */
@Entity('photo')
export default class Photo extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @ManyToOne(() => Company, (company) => company.photos)
  @JoinColumn({ name: 'company_id' })
  company: Company;

  @Column()
  url: string;
}
